package com.xbenben.demo;

import com.xbenben.bean.User;
import org.junit.Test;

import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;

public class NummberDemo {


    private final static ArrayList<User> arrList = new ArrayList<>();

    static {
        arrList.add(new User(Long.valueOf(1), "张三", "北京"));
        arrList.add(new User(Long.valueOf(2), "李四", "天津"));
        arrList.add(new User(Long.valueOf(3), "田七", "北京"));
        arrList.add(new User(Long.valueOf(4), "西瓜", "北京"));
    }

    public static void main(String[] args) {

        AtomicInteger numValue = new AtomicInteger();

        arrList.forEach(res -> {

            numValue.addAndGet(Math.toIntExact(res.getUid()));

        });

        System.out.println(numValue);


    }


    @Test
    public void Inter() {

        Long a = 1011L;
        Long a3 = 1011L;
        long a1 = 10L;

        Integer b1 = 1210;
        Integer b3 = 1210;
        int b2 = 189;


        System.out.println(a.equals(a3));


    }
}
